<template>
    <div>
        <input type="text" :value="msg" @input="$emit('update:msg',$event.target.value)" />
    </div>
</template>

<script>
    //组件间通信的方法
    //vuex(数据共享) 事件总线(非父子组件)
    export default{
        props: [
            'msg'
        ],
        emits: [
            'update:msg'
        ],
        inject: [
            'test'
        ],
        data() {
            return {
                
            }
        },
        methods: {
            
        },
        mounted() {
            console.log(this.test)
        }
    }
</script>

<style scoped>

</style>